home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Reference Guide
/
C-C++ Interactive Reference Guide.iso
/
c_ref
/
csource5
/
357_01
/
cstar1.exe
/
T2.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-18
|
22KB
|
888 lines
/*
C* tables
instruction lookup tables
lengths and address modes
opcode assignments
Version:
March 6, 1987
March 7, 1989
PUBLIC DOMAIN SOFTWARE
The CSTAR program was placed in the public domain on June 15, 1991,
by its author and sole owner,
Edward K. Ream
1617 Monroe Street
Madison, WI 53711
(608) 257-0802
CSTAR may be used for any commercial or non-commercial purpose.
See cstar.h or cstar.c for a DISCLAIMER OF WARRANTIES.
*/
#include "enum.h"
#define X_T_FRAME 6
#define NULL 0L
/*
NOTE: X_TOK synonyms such as follows are dealt with in enum.h
X_BLO == X_BCS
X_BHS == X_BCC
X_DBRA == X_DBF ;note that this is branch UNTIL false
X_DBRN == X_DBT
X_DBLO == X_DBCS
X_DBHS == X_DBCC
X_SLO == X_SCS
X_SHS == X_SCC
other synonyms that might arise ought to be handled similarly
*/
/*
These are the visible instructions in order,
as on pp. 82-182 of The Book.
AS_1_AM means that the (second) argument must match the first as
to length.
MODE1_AM means that the argument length is not orthogonal to
the addressing mode, and the interpreter is to refer to the
addressing mode of the (first) argument to determine whether the
length is acceptable.
In case an operand does not match the template as to length, an
error will be flagged--EXCEPT when the operand is a D register
and its type is not required to determine the operation size.
Thus, a muls into a word-length D register will issue a warning,
as will a moveq into that register. However, moving a long into
a memory word is an error.
The arguments are:
1. 0 for fixed or unsized ops, 1 if the size of the first
c_arg is the size of the op, 2 if the size of the second
is the size of the op.
2. Permissible size for first c_arg in this entry
3. Permissible size for second c_arg in this entry
4. Permissible address modes for first c_arg
5. Permissible address modes for second c_arg
6. Token that should be substituted into code node if this
entry is accepted.
CAUTION: the code in io.c needs to be synchronized to the internal
structure of this table. This seems like an obvious point, but...
NOTE: the old name "entry" conflicts with an ANSI keyword
The designators AS_1, MODE1, and MODE2 are associated with the
interpreter internals and should be somewhat self-expanatory.
AS_1 indicates that arg2 should match whatever length arg1 has.
MODE1 is a filler which indicates that the length is implicit in
the address mode AND is checked by the am_match() code for that
address mode. Similarly for MODE2; these fillers indicate to the
interpreter that no length check should apply to their argument
except that done by am_match().
*/
#define code(x) int x[] = {
#define entry_(a,b,c,d,e,f) a,b,c,d,e,f,
#define end_l -1};
/* abcd */
code (abcd_)
entry_(0, LEN8_AM, LEN8_AM, DEC_AM, DEC_AM, X_ABCD)
entry_(0, LEN8_AM, LEN8_AM, DN_AM, DN_AM, X_ABCD)
end_l
/* add */
code(add_)
entry_(2, MODE1_AM, ANY_AM, QUICK8_AM, DALT_AM, X_ADDQ)
entry_(2, MODE1_AM, NOT8_AM, QUICK8_AM, AN_AM, X_ADDQ)
entry_(2, ANY_AM, AS_1_AM, DATA_AM, DN_AM, X_ADD)
entry_(2, ANY_AM, AS_1_AM, DN_AM, MALT_AM, X_ADD)
entry_(2, NOT8_AM, AS_1_AM, AN_AM, DN_AM, X_ADD)
entry_(1, LEN16_AM, LEN32_AM, GEN_AM, AN_AM, X_ADDA)
entry_(2, NOT8_AM, AS_1_AM, GEN_AM, AN_AM, X_ADDA)
entry_(2, ANY_AM, AS_1_AM, IMM_AM, DALT_AM, X_ADDI)
end_l
/* adda */
code(adda_)
entry_(2, MODE1_AM, NOT8_AM, QUICK8_AM, AN_AM, X_ADDQ)
entry_(1, LEN16_AM, LEN32_AM, GEN_AM, AN_AM, X_ADDA)
entry_(2, NOT8_AM, AS_1_AM, GEN_AM, AN_AM, X_ADDA)
end_l
/* addi */
code(addi_)
entry_(2, MODE1_AM, ANY_AM, QUICK8_AM, DALT_AM, X_ADDQ)
entry_(2, ANY_AM, AS_1_AM, IMM_AM, DALT_AM, X_ADDI)
end_l
/* addq */
code(addq_)
entry_(2, MODE1_AM, ANY_AM, QUICK8_AM, DALT_AM, X_ADDQ)
entry_(2, MODE1_AM, NOT8_AM, QUICK8_AM, AN_AM, X_ADDQ)
end_l
/* addx */
code(addx_)
entry_(2, ANY_AM, AS_1_AM, DEC_AM, DEC_AM, X_ADDX)
entry_(2, ANY_AM, AS_1_AM, DN_AM, DN_AM, X_ADDX)
end_l
/* extra opcodes will eventually be added to the X_TOK enumeration */
#define X_ANDI1 X_ANDI
#define X_ANDI2 X_ANDI
#define X_ANDI3 X_ANDI
/* and */
code(and_)
entry_(2, ANY_AM, AS_1_AM, DATA_AM, DN_AM, X_AND)
entry_(2, ANY_AM, AS_1_AM, DN_AM, MALT_AM, X_AND)
entry_(2, ANY_AM, AS_1_AM, IMM_AM, DALT_AM, X_ANDI3)
end_l
/* andi */
code(andi_)
entry_(2, LEN8_AM, AS_1_AM, IMM8_AM, CCR_AM, X_ANDI1) /* to ccr */
entry_(2, LEN16_AM, AS_1_AM, IMM16_AM, SR_AM, X_ANDI2) /* to ssr */
entry_(2, ANY_AM, AS_1_AM, IMM_AM, DALT_AM, X_ANDI3)
end_l
/* asl */
#define X_ASL1 X_ASL
#define X_ASL2 X_ASL
code(asl_)
entry_(2, ANY_AM, ANY_AM, DN_AM, DN_AM, X_ASL1) /* dreg dyn */
entry_(2, MODE1_AM, ANY_AM, QUICK8_AM, DN_AM, X_ASL1) /* dreg stat */
entry_(1, LEN16_AM, NONE_AM, MALT_AM, NONE_AM, X_ASL2) /* memory x1 */
end_l
/* asr */
#define X_ASR1 X_ASR
#define X_ASR2 X_ASR
code(asr_)
entry_(2, ANY_AM, ANY_AM, DN_AM, DN_AM, X_ASR1) /* dreg dyn */
entry_(2, MODE1_AM, ANY_AM, QUICK8_AM, DN_AM, X_ASR1) /* dreg stat */
entry_(1, LEN16_AM, NONE_AM, MALT_AM, NONE_AM, X_ASR2) /* memory x1 */
end_l
/* bchg */
#define X_BCHG1 X_BCHG
#define X_BCHG2 X_BCHG
code(bchg_)
entry_(2, MODE1_AM, LEN8_AM, BIT31_AM, MALT_AM, X_BCHG1) /* static */
entry_(2, MODE1_AM, LEN32_AM, BIT31_AM, DN_AM, X_BCHG1)
entry_(2, ANY_AM, LEN8_AM, DN_AM, MALT_AM, X_BCHG2) /* dynamic */
entry_(2, ANY_AM, LEN32_AM, DN_AM, DN_AM, X_BCHG2)
end_l
/* bclr */
#define X_BCLR1 X_BCLR
#define X_BCLR2 X_BCLR
code(bclr_)
entry_(2, MODE1_AM, LEN8_AM, BIT31_AM, MALT_AM, X_BCLR1) /* static */
entry_(2, MODE1_AM, LEN32_AM, BIT31_AM, DN_AM, X_BCLR1)
entry_(2, ANY_AM, LEN8_AM, DN_AM, MALT_AM, X_BCLR2) /* dynamic */
entry_(2, ANY_AM, LEN32_AM, DN_AM, DN_AM, X_BCLR2)
end_l
/* bset */
#define X_BSET1 X_BSET
#define X_BSET2 X_BSET
code(bset_)
entry_(2, MODE1_AM, LEN8_AM, BIT31_AM, MALT_AM, X_BSET1) /* static */
entry_(2, MODE1_AM, LEN32_AM, BIT31_AM, DN_AM, X_BSET1)
entry_(2, ANY_AM, LEN8_AM, DN_AM, MALT_AM, X_BSET2) /* dynamic */
entry_(2, ANY_AM, LEN32_AM, DN_AM, DN_AM, X_BSET2)
end_l
/* btst */
#define X_BTST1 X_BTST
#define X_BTST2 X_BTST
code(btst_)
entry_(2, MODE1_AM, LEN8_AM, BIT31_AM, MALT_AM, X_BTST1) /* static */
entry_(2, MODE1_AM, LEN32_AM, BIT31_AM, DN_AM, X_BTST1)
entry_(2, ANY_AM, LEN8_AM, DN_AM, MALT_AM, X_BTST2) /* dynamic */
entry_(2, ANY_AM, LEN32_AM, DN_AM, DN_AM, X_BTST2)
end_l
/* bsr */
code(bsr_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BSR)
end_l
/* bra */
code(bra_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BRA)
end_l
/* bcc */
code(bcc_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BCC)
end_l
/* bcs */
code(bcs_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BCS)
end_l
/* beq */
code(beq_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BEQ)
end_l
/* bge */
code(bge_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BGE)
end_l
/* bgt */
code(bgt_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BGT)
end_l
/* bhi */
code(bhi_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BHI)
end_l
/* ble */
code(ble_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BLE)
end_l
/* bls */
code(bls_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BLS)
end_l
/* blt */
code(blt_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BLT)
end_l
/* bmi */
code(bmi_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BMI)
end_l
/* bne */
code(bne_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BNE)
end_l
/* bpl */
code(bpl_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BPL)
end_l
/* bvc */
code(bvc_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BVC)
end_l
/* bvs */
code(bvs_)
entry_(1, MODE1_AM, NONE_AM, DISP_AM, NONE_AM, X_BVS)
end_l
/* chk */
code(chk_)
entry_(2, LEN16_AM, AS_1_AM, DATA_AM, DN_AM, X_CHK)
end_l
/* clr */
code(clr_)
entry_(1, ANY_AM, NONE_AM, DALT_AM, NONE_AM, X_CLR)
end_l
/* cmp */
code(cmp_)
entry_(2, ANY_AM, AS_1_AM, DATA_AM, DN_AM, X_CMP)
entry_(2, NOT8_AM, AS_1_AM, AN_AM, DN_AM, X_CMP)
entry_(2, NOT8_AM, AS_1_AM, GEN_AM, AN_AM, X_CMPA)
entry_(1, LEN16_AM, LEN32_AM, GEN_AM, AN_AM, X_CMPA)
entry_(2, ANY_AM, AS_1_AM, IMM_AM, DALT_AM, X_CMPI)
end_l
/* cmpa */
code(cmpa_)
entry_(2, NOT8_AM, AS_1_AM, GEN_AM, AN_AM, X_CMPA)
entry_(1, LEN16_AM, LEN32_AM, GEN_AM, AN_AM, X_CMPA)
end_l
/* cmpi */
code(cmpi_)
entry_(2, ANY_AM, AS_1_AM, IMM_AM, DALT_AM, X_CMPI)
end_l
/* cmpm */
code(cmpm_)
entry_(2, ANY_AM, AS_1_AM, INC_AM, INC_AM, X_CMPM)
end_l
/* dbra */
code(dbra_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBRA)
end_l
/* dbcc */
code(dbcc_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBCC)
end_l
/* dbcs */
code(dbcs_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBCS)
end_l
/* dbeq */
code(dbeq_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBEQ)
end_l
/* dbf */
code(dbf_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBF)
end_l
/* dbge */
code(dbge_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBGE)
end_l
/* dbgt */
code(dbgt_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBGT)
end_l
/* dbhi */
code(dbhi_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBHI)
end_l
/* dble */
code(dble_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBLE)
end_l
/* dbls */
code(dbls_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBLS)
end_l
/* dblt */
code(dblt_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBLT)
end_l
/* dbmi */
code(dbmi_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBMI)
end_l
/* dbne */
code(dbne_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBNE)
end_l
/* dbpl */
code(dbpl_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBPL)
end_l
/* dbt */
code(dbt_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBT)
end_l
/* dbvc */
code(dbvc_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBVC)
end_l
/* dbvs */
code(dbvs_)
entry_(0, LEN16_AM, MODE2_AM, DN_AM, DISP_AM, X_DBVS)
end_l
/* divs */
code(divs_)
entry_(0, LEN16_AM, NOT8_AM, DATA_AM, DN_AM, X_DIVS)
end_l
/* divu */
code(divu_)
entry_(0, LEN16_AM, NOT8_AM, DATA_AM, DN_AM, X_DIVU)
end_l
/* eor */
code(eor_)
entry_(2, ANY_AM, AS_1_AM, DN_AM, DALT_AM, X_EOR)
end_l
/* eori */
#define X_EORI1 X_EORI
#define X_EORI2 X_EORI
#define X_EORI3 X_EORI
code(eori_)
entry_(0, LEN8_AM, AS_1_AM, IMM8_AM, CCR_AM, X_EORI1) /* to ccr */
entry_(0, LEN16_AM, AS_1_AM, IMM16_AM, SR_AM, X_EORI2) /* to ssr */
entry_(2, ANY_AM, AS_1_AM, IMM_AM, DALT_AM, X_EORI3)
end_l
/* exg */
#define X_EXG1 X_EXG
#define X_EXG2 X_EXG
#define X_EXG3 X_EXG
#define X_EXG4 X_EXG
code(exg_)
entry_(0, LEN32_AM, AS_1_AM, AN_AM, AN_AM, X_EXG1)
entry_(0, LEN32_AM, AS_1_AM, DN_AM, DN_AM, X_EXG2)
entry_(0, LEN32_AM, AS_1_AM, AN_AM, DN_AM, X_EXG3)
entry_(0, LEN32_AM, AS_1_AM, DN_AM, AN_AM, X_EXG4)
end_l
/* ext */
code(ext_)
entry_(1, NOT8_AM, NONE_AM, DN_AM, NONE_AM, X_EXT)
end_l
/* ----- comment out (illegal)
code(ill_)
entry_(0, NONE_AM, NONE_AM, NONE_AM, NONE_AM, X_ILL)
end_l
------- */
/* jmp */
code(jmp_)
entry_(0, MODE1_AM, NONE_AM, CONTROL_AM, NONE_AM, X_JMP)
end_l
/* jsr */
code(jsr_)
entry_(0, MODE1_AM, NONE_AM, CONTROL_AM, NONE_AM, X_JSR)
end_l
/* lea */
code(lea_)
entry_(0, MODE1_AM, LEN32_AM, CONTROL_AM, AN_AM, X_LEA)
end_l
/* link */
code(link_)
entry_(0, LEN32_AM, LEN16_AM, AN_AM, IMM16_AM, X_LINK)
end_l
/* lsl */
#define X_LSL1 X_LSL
#define X_LSL2 X_LSL
code(lsl_)
entry_(2, ANY_AM, ANY_AM, DN_AM, DN_AM, X_LSL1) /* dreg dyn */
entry_(2, MODE1_AM, ANY_AM, QUICK8_AM, DN_AM, X_LSL1) /* dreg stat */
entry_(1, LEN16_AM, NONE_AM, MALT_AM, NONE_AM, X_LSL2) /* memory x1 */
end_l
/* lsr */
#define X_LSR1 X_LSR
#define X_LSR2 X_LSR
code(lsr_)
entry_(2, ANY_AM, ANY_AM, DN_AM, DN_AM, X_LSR1) /* dreg dyn */
entry_(2, MODE1_AM, ANY_AM, QUICK8_AM, DN_AM, X_LSR1) /* dreg stat */
entry_(1, LEN16_AM, NONE_AM, MALT_AM, NONE_AM, X_LSR2) /* memory x1 */
end_l
/* move */
#define X_MOVE1 X_MOVE
#define X_MOVE2 X_MOVE
#define X_MOVE3 X_MOVE
#define X_MOVE4 X_MOVE
#define X_MOVE5 X_MOVE
code(move_)
entry_(0, MODE1_AM, LEN32_AM, Q8BIT_AM, DN_AM, X_MOVEQ)
entry_(0, ANY_AM, AS_1_AM, GEN_AM, DALT_AM, X_MOVE)
entry_(1, LEN16_AM, LEN32_AM, GEN_AM, AN_AM, X_MOVEA)
entry_(0, NOT8_AM, AS_1_AM, GEN_AM, AN_AM, X_MOVEA)
entry_(0, LEN8_AM, AS_1_AM, CCR_AM, DALT_AM, X_MOVE1) /* ccr */
entry_(0, LEN8_AM, AS_1_AM, DATA_AM, CCR_AM, X_MOVE2)
entry_(0, LEN16_AM, AS_1_AM, SR_AM, DALT_AM, X_MOVE3) /* ssr */
entry_(0, LEN16_AM, AS_1_AM, DATA_AM, SR_AM, X_MOVE4)
entry_(0, LEN32_AM, AS_1_AM, USP_AM, AN_AM, X_MOVE5) /* usp */
entry_(0, LEN32_AM, AS_1_AM, AN_AM, USP_AM, X_MOVE5)
end_l
/* movea */
code(movea_)
entry_(1, LEN16_AM, LEN32_AM, GEN_AM, AN_AM, X_MOVEA)
entry_(0, NOT8_AM, AS_1_AM, GEN_AM, AN_AM, X_MOVEA)
end_l
/* movem */
/*
WARNING: right now, we can't even parse the reg_list!
NOTE: the normal way of handling the size may not work
naturally in some cases--we may want movem_l and movem_w.
That is, we can't simultaneously declare short int *a7 and
long int *a7, so we can't mix word and long movem's in the
same routine except with explicit casts.
*/
code(movem_)
entry_(2, NOT8_AM, AS_1_AM, REGLIST_AM, MOVER2M_AM, X_MOVEM)
entry_(1, NOT8_AM, AS_1_AM, MOVEM2R_AM, REGLIST_AM, X_MOVEM)
end_l
/* movep */
/*
NOTE: same comment as movem.
For this one, I suggest having ONLY movep_l and movep_w, since
the operation is incredibly bizarre.
*/
code(movep_)
entry_(1, NOT8_AM, AS_1_AM, DN_AM, D_AN_AM, X_MOVEP)
entry_(2, NOT8_AM, AS_1_AM, D_AN_AM, DN_AM, X_MOVEP)
end_l
/* moveq */
code(moveq_)
entry_(2, MODE1_AM, LEN32_AM, Q8BIT_AM, DN_AM, X_MOVEQ)
end_l
/* muls */
code(muls_)
entry_(0, LEN16_AM, NOT8_AM, DALT_AM, DN_AM, X_MULS)
end_l
/* mulu */
code(mulu_)
entry_(0, LEN16_AM, NOT8_AM, DALT_AM, DN_AM, X_MULU)
end_l
/* nbcd */
code(nbcd_)
entry_(0, LEN8_AM, NONE_AM, DALT_AM, NONE_AM, X_NBCD)
end_l
/* neg */
code(neg_)
entry_(1, ANY_AM, NONE_AM, DALT_AM, NONE_AM, X_NEG)
end_l
/* negx */
code(negx_)
entry_(1, ANY_AM, NONE_AM, DALT_AM, NONE_AM, X_NEGX)
end_l
/* nop */
code(nop_)
entry_(0, NONE_AM, NONE_AM, NONE_AM, NONE_AM, X_NOP)
end_l
/* not */
code(not_)
entry_(1, ANY_AM, NONE_AM, DALT_AM, NONE_AM, X_NOT)
end_l
/* or */
code(or_)
entry_(1, ANY_AM, AS_1_AM, DATA_AM, DN_AM, X_OR)
entry_(2, ANY_AM, AS_1_AM, DN_AM, MALT_AM, X_OR)
end_l
/* ori */
#define X_ORI1 X_ORI
#define X_ORI2 X_ORI
#define X_ORI3 X_ORI
code(ori_)
entry_(2, ANY_AM, AS_1_AM, IMM_AM, DALT_AM, X_ORI3)
entry_(0, LEN8_AM, AS_1_AM, IMM8_AM, CCR_AM, X_ORI1) /* to ccr */
entry_(0, LEN16_AM, AS_1_AM, IMM16_AM, SR_AM, X_ORI2) /* to ssr */
end_l
/* pea */
code(pea_)
entry_(0, MODE1_AM, NONE_AM, CONTROL_AM, NONE_AM, X_PEA)
end_l
/* reset */
code(reset_)
entry_(0, NONE_AM, NONE_AM, NONE_AM, NONE_AM, X_RESET)
end_l
/* rol */
#define X_ROL1 X_ROL
#define X_ROL2 X_ROL
code(rol_)
entry_(2, ANY_AM, ANY_AM, DN_AM, DN_AM, X_ROL1) /* dreg dyn */
entry_(2, MODE1_AM, ANY_AM, QUICK8_AM, DN_AM, X_ROL1) /* dreg stat */
entry_(2, LEN16_AM, NONE_AM, MALT_AM, NONE_AM, X_ROL2) /* memory x1 */
end_l
/* ror */
#define X_ROR1 X_ROR
#define X_ROR2 X_ROR
code(ror_)
entry_(2, ANY_AM, ANY_AM, DN_AM, DN_AM, X_ROR1) /* dreg dyn */
entry_(2, MODE1_AM, ANY_AM, QUICK8_AM, DN_AM, X_ROR1) /* dreg stat */
entry_(2, LEN16_AM, NONE_AM, MALT_AM, NONE_AM, X_ROR2) /* memory x1 */
end_l
/* roxl */
#define X_ROXL1 X_ROXL
#define X_ROXL2 X_ROXL
code(roxl_)
entry_(2, ANY_AM, ANY_AM, DN_AM, DN_AM, X_ROXL1) /* dreg dyn */
entry_(2, MODE1_AM, ANY_AM, QUICK8_AM, DN_AM, X_ROXL1) /* dreg stat */
entry_(2, LEN16_AM, NONE_AM, MALT_AM, NONE_AM, X_ROXL2) /* memory x1 */
end_l
/* roxr */
#define X_ROXR1 X_ROXR
#define X_ROXR2 X_ROXR
code(roxr_)
entry_(2, ANY_AM, ANY_AM, DN_AM, DN_AM, X_ROXL1) /* dreg dyn */
entry_(2, MODE1_AM, ANY_AM, QUICK8_AM, DN_AM, X_ROXL1) /* dreg stat */
entry_(2, LEN16_AM, NONE_AM, MALT_AM, NONE_AM, X_ROXL2) /* memory x1 */
end_l
/* rte */
code(rte_)
entry_(0, NONE_AM, NONE_AM, NONE_AM, NONE_AM, X_RTE)
end_l
/* rtr */
code(rtr_)
entry_(0, NONE_AM, NONE_AM, NONE_AM, NONE_AM, X_RTR)
end_l
/* rts */
code(rts_)
entry_(0, NONE_AM, NONE_AM, NONE_AM, NONE_AM, X_RTS)
end_l
/* sbcd */
code(sbcd_)
entry_(0, LEN8_AM, AS_1_AM, DEC_AM, DEC_AM, X_SBCD)
entry_(0, LEN8_AM, AS_1_AM, DN_AM, DN_AM, X_SBCD)
end_l
/* scc */
code(scc_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SCC)
end_l
/* scs */
code(scs_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SCS)
end_l
/* seq */
code(seq_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SEQ)
end_l
/* sf */
code(sf_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SF)
end_l
/* sge */
code(sge_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SGE)
end_l
/* sgt */
code(sgt_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SGT)
end_l
/* shi */
code(shi_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SHI)
end_l
/* sle */
code(sle_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SLE)
end_l
/* sls */
code(sls_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SLS)
end_l
/* slt */
code(slt_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SLT)
end_l
/* smi */
code(smi_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SMI)
end_l
/* sne */
code(sne_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SNE)
end_l
/* spl */
code(spl_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SPL)
end_l
/* st */
code(st_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_ST)
end_l
/* svc */
code(svc_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SVC)
end_l
/* svs */
code(svs_)
entry_(0, LEN8_AM, MODE2_AM, DN_AM, DISP_AM, X_SVS)
end_l
/* stop */
/* privileged instruction */
code(stop_)
entry_(0, ANY_AM, NONE_AM, IMM16_AM, NONE_AM, X_STOP)
end_l
/* sub */
code(sub_)
entry_(2, MODE1_AM, ANY_AM, QUICK8_AM, DALT_AM, X_SUBQ)
entry_(2, MODE1_AM, NOT8_AM, QUICK8_AM, AN_AM, X_SUBQ)
entry_(2, ANY_AM, AS_1_AM, DATA_AM, DN_AM, X_SUB)
entry_(2, ANY_AM, AS_1_AM, DN_AM, MALT_AM, X_SUB)
entry_(2, NOT8_AM, AS_1_AM, AN_AM, DN_AM, X_SUB)
entry_(1, LEN16_AM, LEN32_AM, GEN_AM, AN_AM, X_SUBA)
entry_(2, NOT8_AM, AS_1_AM, GEN_AM, AN_AM, X_SUBA)
entry_(2, ANY_AM, AS_1_AM, IMM_AM, DALT_AM, X_SUBI)
end_l
/* suba */
code(suba_)
entry_(2, MODE1_AM, NOT8_AM, QUICK8_AM, AN_AM, X_SUBQ)
entry_(1, LEN16_AM, LEN32_AM, GEN_AM, AN_AM, X_SUBA)
entry_(2, NOT8_AM, AS_1_AM, GEN_AM, AN_AM, X_SUBA)
end_l
/* subi */
code(subi_)
entry_(2, MODE1_AM, ANY_AM, QUICK8_AM, DALT_AM, X_SUBQ)
entry_(2, ANY_AM, AS_1_AM, IMM_AM, DALT_AM, X_SUBI)
end_l
/* subq */
code(subq_)
entry_(2, MODE1_AM, ANY_AM, QUICK8_AM, DALT_AM, X_SUBQ)
entry_(2, MODE1_AM, NOT8_AM, QUICK8_AM, AN_AM, X_SUBQ)
end_l
/* subx */
code(subx_)
entry_(2, ANY_AM, AS_1_AM, DEC_AM, DEC_AM, X_SUBX)
entry_(2, ANY_AM, AS_1_AM, DN_AM, DN_AM, X_SUBX)
end_l
/* swap */
code(swap_)
entry_(0, NOT8_AM, NONE_AM, DN_AM, NONE_AM, X_SWAP)
end_l
/* tas */
code(tas_)
entry_(0, LEN8_AM, AS_1_AM, DALT_AM, NONE_AM, X_TAS)
end_l
/* trap */
code(trap_)
entry_(0, MODE1_AM, NONE_AM, TRAP15_AM, NONE_AM, X_TRAP)
end_l
/* trapv */
code(trapv_)
entry_(0, MODE1_AM, NONE_AM, TRAP15_AM, NONE_AM, X_TRAPV)
end_l
/* tst */
code(tst_)
entry_(1, ANY_AM, NONE_AM, DALT_AM, NONE_AM, X_TST)
end_l
/* unlk */
code(unlk_)
entry_(0, LEN32_AM, NONE_AM, AN_AM, NONE_AM, X_UNLK)
end_l
/*
x_token lookup list--these entries are to correspond in sequence
to the X_TOK list in enum.h, so that the table for an X_TOK
is *x_lookup[X_TOK], and an integer in that table is
(*x_lookup[X_TOK])[i]; note that the parentheses are essential!
an entry consists of five integers
*/
/* WARNING: illegal (p. 125 of the Book) is not in X_TOK enumeration */
#define X_ILL 0
int *x_lookup[] = {
NULL, /* X_TOK is zero */
abcd_, add_, adda_, addi_, addq_,
addx_, and_, andi_, asl_, asr_,
bchg_, bclr_, bra_, bset_, bsr_,
btst_, NULL, chk_, clr_, cmp_, /* NULL bxx */
cmpa_, cmpi_, cmpm_, NULL, divs_, /* dbxx */
divu_, eor_, eori_, exg_, ext_,
jmp_, jsr_, lea_, link_, lsl_, /* insert ILL in this line */
lsr_, move_, movea_, movem_, movep_,
moveq_,muls_, mulu_, nbcd_, neg_,
negx_, nop_, not_, or_, ori_,
pea_, reset_,rol_, ror_, roxl_,
roxr_, rte_, rtr_, rts_, sbcd_,
NULL, stop_, sub_, suba_, subi_, /* sxx */
subq_, subx_, swap_, tas_, trap_,
trapv_,tst_, unlk_,
NULL, NULL, /* MODS, MODU */
bcc_, bcs_, beq_, bge_, bgt_, bhi_, ble_,
bls_, blt_, bmi_, bne_, bpl_, bvc_, bvs_,
dbcc_, dbcs_, dbeq_, dbf_, dbge_, dbgt_, dbhi_, dble_,
dbls_, dblt_, dbmi_, dbne_, dbpl_, dbt_, dbvc_, dbvs_,
scc_, scs_, seq_, sf_, sge_, sgt_, shi_, sle_,
sls_, slt_, smi_, sne_, spl_, st_, svc_, svs_,
NULL
};